<template>
	<div class="follow">
	  <van-pull-refresh v-model="refreshing" @refresh="onRefresh"
	  success-text="刷新成功"
	  >
		  <p>刷新次数: {{ count }}</p>
		<van-list
		  v-model="loading"
		  
		  :finished="finished"
		  finished-text="没有更多了"
		  :error.sync="error"
		  error-text="请求失败，点击重新加载"
		  @load="follow"
		>
		 <van-cell  v-for="(item,index) of follow" :key="item._id" :title="index + 1 +' . '+ item.title"
		 	:label="item.des" :to="`/follow/${item._id}?collectionName=follow`"  ><a herf=" " id="pic"><img :src="item.detail.auth_icon"/> </a></van-cell>
		</van-list>
	 </van-pull-refresh>		
	</div>
</template>

<script>
	import { Toast } from 'vant';
	import {mapState} from 'vuex'
	export default {
		name: 'follow',
		props: {},
		data() {
			return {
				// follow: [],
			    // list: [],
			    loading: false,
			    finished: false,
				error: false,
				refreshing: false,
				count: 0,
			    isLoading: false,
			}
		},
		components: {
			
		},
		mounted() {

			this.$store.dispatch('economic/follow')
		},
		updated() {},
		methods: {
			
		  onRefresh() {						
				// 清空列表数据
				this.finished = false;
							 
				// 重新加载数据
				// 将 loading 设置为 true，表示处于加载状态
				this.loading = true;
				this.follow();
										
		       setTimeout(() => {
		         Toast('刷新成功');
		         this.isLoading = false;
		         this.count++;
		       }, 1000);
			   
		     },
		
		},
	computed: mapState('economic',['follow','list'])
	}
</script>

<style scoped>
	.follow {
		margin-top: 0.5rem;
	}
	#pic{
		width:1.0rem;
		height: 0.5rem;
		margin-right: 1.9375rem;
	}
	#pic img{
	width: 100%;
	height: 100%;
	}
	
</style>


